"use strict";
const common_vendor = require("../../common/vendor.js");
const common_request = require("../../common/request.js");
const vrListImgs = [
  "/static/wenxin.png",
  "/static/bieshu.png"
];
const _sfc_main = {
  onShareAppMessage() {
    return {
      title: "沁园全屋",
      imageUrl: ""
      // path: ""
    };
  },
  data() {
    return {
      title: "Hello",
      buttons: [
        { code: 1, label: "厨下", src: "/static/chuxia.png" },
        { code: 2, label: "净饮", src: "/static/jingyin.png" },
        { code: 3, label: "全屋", src: "/static/quanwu.png" },
        { code: 5, label: "空净", src: "/static/kj.png" }
      ],
      vrList: [
        {
          label: "温馨小屋",
          src: vrListImgs[0],
          links: "https://vr.qinyuan.cn/2/index.html"
        },
        {
          label: "豪华别墅",
          src: vrListImgs[1],
          links: "https://vr.qinyuan.cn/1/index.html"
        }
      ]
    };
  },
  onLoad() {
    this.getVrList();
  },
  methods: {
    getVrList() {
      common_request.service({
        url: "/index/xy_vr"
      }).then((res) => {
        console.log(res);
        if (res) {
          this.vrList = res.map((e, index) => {
            return {
              label: e.name,
              src: vrListImgs[index] || e.icon,
              ...e
            };
          });
        }
      });
    },
    openUrl(item) {
      common_vendor.index.navigateTo({
        url: "/pages/webview/webview?url=" + item.links
      });
    },
    goToPage(item) {
      common_vendor.index.navigateTo({
        url: `/pages/tabbar/tabbar?label=${item.label}&code=${item.code}`
      });
    },
    goToQualityPage() {
      common_vendor.index.navigateTo({
        url: `/pages/quality-query/quality-query`
      });
    },
    goToSoftPage() {
      common_vendor.index.navigateTo({
        url: `/pages/softwater/softwater`
      });
    }
  }
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return {
    a: common_vendor.f($data.vrList, (item, index, i0) => {
      return {
        a: item.src,
        b: common_vendor.t(item.label),
        c: index,
        d: common_vendor.o(($event) => $options.openUrl(item), index)
      };
    }),
    b: common_vendor.f($data.buttons, (item, index, i0) => {
      return {
        a: item.src,
        b: common_vendor.t(item.label),
        c: index,
        d: common_vendor.o(($event) => $options.goToPage(item), index)
      };
    }),
    c: common_vendor.o((...args) => $options.goToQualityPage && $options.goToQualityPage(...args)),
    d: common_vendor.o((...args) => $options.goToSoftPage && $options.goToSoftPage(...args))
  };
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/karo/Desktop/finale/3.0/clean-water/clean-water/pages/index/index.vue"]]);
_sfc_main.__runtimeHooks = 2;
wx.createPage(MiniProgramPage);
